-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve abs()
return type
#3263
Conversation
You've opened the pull request against the latest branch 1.12.x. If your code is relevant on 1.11.x and you want it to be released sooner, please rebase your pull request and change its target to 1.11.x. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many instanceof
questions about types. This will no doubt be imperfect. The need for such code usually means there should a method on Type
instead which will force us to ask the right question in the right places.
Something like Type::getAbsoluteNumericValue(): Type
is the way to go.
Added a |
By the way,
Shouldn't both methods return |
I love it, thanks! |
Fixes phpstan/phpstan#11367.